
#include "removecontexthelpproc.h"

#include <pshpack1.h>
typedef struct DLGTEMPLATEEX
{
    WORD dlgVer;
    WORD signature;
    DWORD helpID;
    DWORD exStyle;
    DWORD style;
    WORD cDlgItems;
    short x;
    short y;
    short cx;
    short cy;
} 
DLGTEMPLATEEX, *LPDLGTEMPLATEEX;
#include <poppack.h>

// Get the flag for the help button out of the property sheet
int CALLBACK RemoveContextHelpProc(HWND hwnd, UINT message, LPARAM lParam)
{
    switch (message) 
	{
    case PSCB_PRECREATE:
        // Remove the DS_CONTEXTHELP style from the dialog template
        if (((LPDLGTEMPLATEEX)lParam)->signature ==  0xFFFF)
		{
            ((LPDLGTEMPLATEEX)lParam)->style &= ~DS_CONTEXTHELP;
        }
        else 
		{
            ((LPDLGTEMPLATE)lParam)->style &= ~DS_CONTEXTHELP;
        }
        return TRUE;
		break;
    }
    return TRUE;
}